import { http } from "@/utils/http";
import type { UserInfo } from "./types";

/**
 * 登录
 * @returns token
 */
export const loginApi = (code: string) => {
  return http.get<{ token: string }>(`/api/ucenter/webChat/callback`, {
    data: {
      code,
    },
  });
};

/**
 * 获取用户信息
 * @returns token
 */
export const getUserInfoApi = () => {
  return http.get<UserInfo>(`/api/ucenter/member/auth/getLoginInfo`);
};
